// src/utils/auth.js
export function checkLoginExpiry() {
  const lastLoginTime = localStorage.getItem('lastLoginTime')
  if (!lastLoginTime) return false
  
  const now = new Date()
  const todayEnd = new Date()
  todayEnd.setHours(23, 59, 59, 999) // 设置当天23:59:59.999
  
  return new Date(lastLoginTime) < todayEnd && now >= todayEnd
}

export function setLoginTime() {
  localStorage.setItem('lastLoginTime', new Date().toISOString())
}

export function clearAuth() {
  localStorage.removeItem('token')
  localStorage.removeItem('lastLoginTime')
  // 清除其他登录相关数据
}